# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        潘炎珍  
# Name:         demo16
# Description:
# Author:       98745
# Date:         2019/3/4
#-------------------------------------------------------------------------------

def nl(n):
    try:
        try:
            n+' '
        except TypeError:
            pass
        else:
            raise TypeError
        for s in n:
            for em in nl(s):
                yield em
    except TypeError:
        yield n
n=['a',['b',['c'],20,123,[['hello world']]]]
for num in nl(n):
    print(num,end=' ')